<?php
	//Refresh the page for refreshment.
	header("Content-type: image/png");
	$r = rand(100, 255);
	$g = rand(100, 255);
	$b = rand(100, 255);
	
	$base = array('red'=>$r, 'green'=>$g, 'blue'=>$b);
	$x=800;
	$y=300;
	$ie = imagecreatetruecolor($x, $y);
	
	$current_red = $base['red'];
	$current_green = $base['green'];
	$current_blue = $base['blue'];
	for($k=0; $k<$y; $k++) //move through each line of height 1 pixel
	{
		if($k%3 == 0)
			$current_blue--;
		else if($k%2 == 0)
			$current_red--;
		else
			$current_green--;
		$current_colour = imagecolorallocate($ie, $current_red, $current_green, $current_blue);
		imagefilledrectangle($ie, 0, $k, $x, $k+1, $current_colour);
	}
	imagepng($ie);
	imagedestroy($ie);
?>